package com.example.demo.controller;

import com.example.demo.bean.Category;
import com.example.demo.bean.HttpResult;
import com.example.demo.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/category")
public class CategoryController {
    @Autowired
    CategoryService categoryService;
    @RequestMapping("/getCategoryList")
    public HttpResult<List<Category>> getCategoryList(){
        HttpResult<List<Category>> result =new HttpResult<>();
        result.setData(categoryService.queryCategory());
        return result;
    }
}
